Computer-implemented gamut mapping

ABSTRACT

In gamut mapping, as the brightness of the original color (S) increases further and further beyond the source gamut ( 110 ) boundary, the corresponding color (S′) in the target gamut ( 120 ) becomes closer and closer to a white color (W). Image distortion is reduced as a result.

BACKGROUND OF THE INVENTION

The present invention relates to color processing performed by acomputer, and more particularly to gamut mapping.

An image may include a color outside of the gamut of a display device onwhich the image is to be displayed. In this case, gamut mapping isperformed to replace the color with another color in the device's gamut.For example, a digital photographic camera may generate an image withcolors outside of the gamut of a computer monitor on which the imagemust be displayed, i.e. the source gamut 110 (FIG. 1) provided by thecamera may contain a color S which is not in the monitor's gamut(“target gamut”) 120. The color S is mapped into a color S′ which iswithin the target gamut. The gamut mapping should preferably avoid largeimage distortion and be computationally inexpensive. See e.g. U.S. Pat.No. 6,560,356 B1 issued May 6, 2003 to Takahashi et al., describinggamut mapping for a color coordinate system L*a*b*.

PCT application published as WO 2005/043887 A1 on 12 May 2005,incorporated herein by reference, describes gamut mapping for a linearRGB color coordinate system. The target gamut 120 consists of all colorswhose RGB coordinates are between 0 and 255 inclusive. The gamut mappingfrom S=(R,G,B) to S′=(R′,G′,B′) is performed in two steps as follows:

1. If at least one of the R, G, B coordinates is negative, the smallestof the negative coordinates (i.e. the negative coordinate of the largestmagnitude) is subtracted from each of the R, G, B coordinates. Thus, thevector S=(R,G,B) is replaced with

S ₁ =S−min(R,G,B)×(1,1,1)   (1)

Clearly, all the coordinates of S₁ are non-negative. Let us denote themas R₁, G₁, B₁.

2. If any of R₁, G₁, B₁ is greater than 255, then S₁ is scaled to withinthe target gamut:

S′=S ₁*255/max(R ₁ ,G ₁ ,B ₁)   (2)

SUMMARY

This section summarizes some features of the invention. Other featuresare described in the subsequent sections. The invention is defined bythe appended claims which are incorporated into this section byreference.

The inventors have observed that if a color is generated by very brightlight, the color looks white or almost white. More particularly, supposea color is produced by light of radiance kP(λ), where k is somemultiplier independent of wavelength λ. (Radiance is defined as theenergy per unit of time per unit of wavelength.) As k increases, thecorresponding color appears closer and closer to white and less and lessdependent on P(λ).

Therefore, in some embodiments of the present invention, the gamutmapping S→S′ is performed so that when S becomes brighter and brighter,S′ gradually converges to a white color regardless of the hue andsaturation of S.

The invention is not limited to the features and advantages describedabove. Other features are described below. The invention is defined bythe appended claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 explains gamut mapping.

FIGS. 2, 3A, 3B illustrate gamut mappings according to some embodimentsof the present invention.

FIG. 4 is a flowchart of gamut mapping according to some embodiments ofthe present invention.

FIG. 5 illustrates a color coordinate system suitable for gamut mappingaccording to some embodiments of the present invention.

FIG. 6 illustrates a visible gamut and a target gamut in the colorcoordinate system of FIG. 5.

FIGS. 7-9 illustrate gamut mapping according to some embodiments of thepresent invention.

DESCRIPTION OF SOME EMBODIMENTS

The embodiments described in this section illustrate but do not limitthe invention. The invention is defined by the appended claims.

FIG. 2 illustrates some embodiments of the present invention. Gamutmapping is performed by a computer system 210 (possibly a distributedsystem) having one or more computer processors 220 executing computerinstructions stored in a computer storage 230 and/or received over anetwork (not shown). The colors are represented by digital data storedin a storage 230 and/or received over a network. The images obtainedusing the gamut mapping are displayed on a display device 240, e.g. acomputer monitor, a television monitor, a printer, a holographic displaydevice, and/or other types of devices. Device 240 may incorporate all orpart of system 210, and in particular some or all of the gamut mappingcan be performed within device 240. In other embodiments, additionalgamut mapping is performed by device 240 before and/or after theprocessing illustrated in FIG. 2.

Colors S₁ through S₄ (FIG. 2) are outside of target gamut 120, and aremapped into respective colors S₁′ through S₄′ which are inside gamut120. Colors are represented as vectors which are denoted by the samesymbols as the corresponding colors. W is a white color. Colors S₁, S₂are “colinear” in the sense that they can be produced by light sourceswhose respective radiance functions P₁(λ), P₂(λ) are multiples of eachother, i.e.

P ₂(λ)=kP ₁(λ)   (3)

for some positive number k independent of λ. In this case, we will saythat

S₂=kS₁   (4)

for colors S₁ and S₂. Intuitively, two colors are colinear if theydiffer in brightness but have the same hue and saturation (thisstatement is imprecise, is not tied to any particular definition of hueand saturation, and does not limit the invention). It is easy to seethat two colors are colinear if they are represented by colinear vectorsin a linear color coordinate system. Also, if condition (4) holds forthe colors, it also holds for the corresponding vectors in any linearcolor coordinate system. (Thus, k is well defined even though a colorcan be generated by different radiance functions.) For convenience ofillustration, we will assume that FIG. 2 represents colors in a linearcolor coordinate system. The invention is not limited to such colorrepresentations however.

In FIG. 2, color S₃ is colinear to S₄.

White color W is on the boundary of target gamut 120. Thus, if W isproduced by a radiance P_(W)(λ), then a color produced by radiancekP_(W)(λ) is outside of gamut 120 for any k>1. Colors S₁′, . . . , S₄′are also on the boundary of gamut 120.

In some embodiments, the gamut mapping satisfies the following condition“GM1”:

Condition GM1: When color S is stretched out more and more (i.e.multiplied by greater and greater constants k>1), the correspondingvector S′ in the target gamut approaches Win some sense. For example, ina linear color coordinate system, the angle between S′ and W maydecrease as k increases. In another example, each coordinate of S′approaches the respective coordinate of W.

In FIG. 2, each vector S′ (i.e. S₁′ through S₄′) is in the same plane asthe corresponding vector S and W. For a linear color coordinate system,this means that S′ is a linear combination of S and W:

S′=α(S)S+β(S)W   (5)

for some numerical α(S) and β(S). See FIG. 3A. The invention is notlimited to S′ being in the same plane as S and W however. Of note, inFIG. 3A, the vector W is not on the gamut boundary. Vector β₀W is on thegamut boundary for some positive β₀. If W is inside gamut 120 (as inFIGS. 2 and 3A), then β₀≧1. If W is outside of gamut 120, then β₀<1. (Itis assumed in this section that the target gamut is convex in the sensethat if S is outside gamut 120 then kS is also outside gamut 120 for anyk>1; this is not generally necessary however.)

Combining the equation (5) and condition GM1, we obtain for someembodiments that if S is held constant and k approaches infinity, then:

α(kS)kS+β(kS)W→β₀W   (6)

Hence, at least if S is not colinear to W, then

α(kS)k→0   (7A)

β(kS)→β₀   (7B)

In some embodiments, if S is colinear to W and is outside of targetgamut 120, then S′=β₀W, so the conditions (7A), (8A) continue to hold.

The invention is not limited to gamut mappings satisfying the conditions(6), (7A), (7B). Of note, source gamut 110 can be a bounded set, so thefunctions α(AS), β(kS) can be undefined for large k. In someembodiments, regardless of whether or not α(kS), β(kS) are defined forarbitrarily large k, the following conditions hold for each fixed S andall positive k such that kS is in source gamut 110 but outside of targetgamut 120:

α(kS)k is a non-negative decreasing function of k   (8A)

β(kS) is a bounded increasing function of k   (8B)

As used herein, the terms “increasing” and “decreasing” do notnecessarily mean strictly increasing or decreasing. However, in someembodiments, the functions α(ks)k and β(kS) are respectively strictlydecreasing and strictly increasing for at least some k. In other words,for all ordered pairs (k₁,k₂), k₁<k₂, of positive numbers such that k₁Sand k₂S are in the source gamut but outside of the target gamut, thefollowing conditions hold true:

α(k ₁ S)k ₁≧α(k ₂ S)k ₂, and

α(k ₁ S)k ₁>α(k ₂ S)k ₂ for at least one pair (k ₁ ,k ₂);   (9A)

β(k ₁ S)≦β(k ₂ S), and

β(k ₁ S)k ₁<β(k ₂ S) for at least one pair (k ₁ ,k ₂).   (9B)

In some embodiments, conditions (9A), (9B) hold for all ordered pairs(k₁,k₂), k₁<k₂, of positive numbers such k₂S is in the source gamut butoutside of the target gamut (i.e. k₁S can be inside the target gamut).If the gamut mapping is clipping, i.e. the colors inside the targetgamut are mapped into themselves, then we can set β(S)=0 and α(S)=1 whenS is in the target gamut.

In some embodiments, the functions α and β are defined as follows. LetS_(Bmax)(S) denote the largest vector colinear to S in target gamut 120.FIG. 2 illustrates S_(Bmax)(S) for vectors S=S₁ and S=S₃. Clearly,S_(Bmax)(S₂)=S_(Bmax)(S₁), and S_(Bmax)(S₄)=S_(Bmax)(S₃) Intuitively,S_(Bmax)(S) is the brightest color having the same hue and saturation asS in gamut 120. S_(Bmax) is on the gamut boundary. If S is not zero andS_(Bmax)(S) is not zero, then the following condition holds for somek>1:

S=kS _(Bmax)(S)   (10)

where k is a function of S. The number k can be thought of as|S|/|S_(Bmax)| where |•| represents a vector's length. The vector lengthcan be thought of as a measure of brightness. Replacing S with S_(Bmax)in equations (7A), (7B), we obtain for k→∞:

α(kS_(Bmax))k→0   (11A)

β(kS_(Bmax))→β₀   (11B)

In some embodiments, the values α(S) and β(S) are entirely defined by k.In this case, we can define α(k) and β(k) as follows:

α(k)=α(kS _(Bmax)), β(k)=β(kS _(Bmax))   (12)

Then (11A), (11B) can be re-written as (13A), (13B) below. In someembodiments, α(k) and β(k) are continuous functions. If the gamutmapping is clipping, i.e. S′=S for all S in gamut 120, then (13C) and(13D) below hold true.

α(k)k→0 as k→∞  (13A)

β(k)→β₀ as k→∞  (13B)

α(1)=1   (13C)

β(1)=0   (13D)

Possible choices for α(k) and β(k) include:

α(k)=1/k ^(1+p)

β(k)=β₀(1−1/k ^(q))   (14)

where p>0 and q>0 are constant with respect to k for a given hue andsaturation, i.e. a given S_(Bmax). The numbers p and q may or may notdepend on S_(Bmax).

The equations (14) define α(k) and β(k) for k≧1 and for S_(Bmax)(S)being non-colinear to W. Different functions α(k) and β(k) (e.g.different p and q values) can be used for different S_(Bmax) values. Insome embodiments,

q=p   (15)

Good practical results (i.e. little image distortion) have been achievedfor (14), (15) when p was independent of S_(Bmax) and was in the range:

⅓≦p≦½  (16)

e.g. p=½ for all S_(Bmax) values. Of note, p=½ allows computationallyinexpensive implementations on many computers due to efficientcomputation of square roots.

In (10), it was assumed that:

S_(Bmax)(S)≠0   (17)

However, in the RGB example described above in connection withexpressions (1) and (2), the condition (17) does not hold if S has anegative RGB coordinate. In some embodiments of the present invention,the gamut mapping is performed in two stages. At stage 410 (FIG. 4), theimage is transformed to map the source gamut into a region in which (17)holds for any vector S outside of the target gamut, e.g. the region R≧0,G≧0, B≧0 in the case of equation (1). Step 410 can be accomplished viaequation (1) or by other techniques some of which are described below.At stage 420, further gamut mapping (e.g. clipping) is performed asdescribed above in connection with equations (5)-(17).

For illustration, let us apply the techniques (14), (15) to a linear RGBsystem. Suppose the target gamut consists of all the colors whose R, G,B coordinates are between 0 and 1 inclusive. Color W=(1,1,1) is a whitecolor. Clearly, W is on the target gamut's boundary (β₀=1). First, step410 is performed using the equation (1) or some other technique. Thecolors at the output of step 410 have only non-negative RGB coordinates,but some coordinates may be greater than 1. If a color S=(R,G,B) outputby step 410 has max(R,G,B)>1, then S_(Bmax)(S)=S/max(R,G,B), andk=max(R,G,B). Therefore, setting q=p in equation (14), we obtain

$\begin{matrix}{S^{\prime} = \frac{S + {\left( {1\text{,}1\text{,}1} \right){k\left( {k^{p} - 1} \right)}}}{k^{1} + p}} & (18)\end{matrix}$

Good practical results have been achieved for p as in (16), but theinvention is not limited to such p values. Of note, (18) iscomputationally inexpensive, especially if p=½. See Appendix A below forone computer implementation.

In some embodiments, the functions α(k), β(k) may or may not satisfy(14) but satisfy the following conditions for any S_(Bmax) non-colinearto W:

0<α(k)≦1/k ^(1+p)

1>β(k)/β₀≧1−1/k ^(q)   (19)

These functions may or may not be defined for all values of k.

As noted above in the statement of condition GM1, the gamut mapping canbe defined in terms of the angle between S and W. If W represents awhite color, then this angle can be thought of as chroma (saturation).Denoting the angle between S and W as C and the angle between S′ and Was C′, we can write

C′=φ(S)   (20)

where φ is a suitable function. The color S′ can be defined by the angleC′ and some additional conditions. In some embodiments, S′ is defined bythe following condition (21):

S′ satisfies (20) and lies on the gamut boundary and in the same planeas S and W   (21)

In some embodiments, for any fixed non-zero S in the source gamut,

φ(kS)→0 as k→∞  (22)

In addition, or alternatively, φ(kS) can be a decreasing function of k,possibly strictly decreasing for at least some k. In other words, forall ordered pairs (k₁,k₂), k₁<k₂, of positive numbers such that k₁S andk₂S are in the source gamut but outside of the target gamut, thefollowing condition holds true:

φ(k ₂ S)≦φ(k ₁ S), and

φ(k ₂ S)<φ(k ₁ S) for at least one pair (k ₁ ,k ₂)   (23)

In some embodiments, (23) holds for all ordered pairs (k₁,k₂), k₁<k₂, ofpositive numbers such k₂S is in the source gamut but outside of thetarget gamut (i.e. k₁S can be inside the target gamut). If the gamutmapping is clipping, i.e. the colors in the target gamut are mapped intothemselves, then we can set φ(S)=C when S is in the target gamut.

For k as in (10), condition (22) becomes:

φ(kS_(BMax))→0 as k→∞  (24)

and (23) becomes:

φ(k ₂ S _(BMax))≦φ(k ₁ S _(BMax)), and

φ(k ₂ S)<φ(k ₁ S) for at least one pair

(k ₁ ,k ₂)   (25)

In some embodiments, the values φ(S) are entirely defined by k and C,where k is as in (10) and C is the angle between S and W (and hencebetween S_(Bmax) and W). In this case, we can write φ(kS_(Bmax)) asφ(k,C). Then (24) can be re-written as (26A) below. Further, in someembodiments, φ(k,C) is continuous in k, and satisfies some boundaryconditions on the target gamut's boundary. For example, if the gamutmapping is clipping, then (26B) below holds true.

φ(k,C)→0 as k→∞  (26A)

φ(1,C)=C   (26B)

Possible choices for φ(k,C) include:

φ(k,C)=C/k ^(p)   (27)

where p>0 is constant with respect to k for a given hue and a givensaturation C, i.e. for a given S_(Bmax). The number p may or may not beconstant with respect to C or other S_(Bmax) parameters.

The equation (27) defines φ(k) for k≧1 and for S_(Bmax)(S) beingnon-colinear to W. Different functions φ(k) (e.g. different p values)can be used for different S_(Bmax) values. In some embodiments,psatisfies (16). In some embodiments,

0<φ(k,C)≦C/k ^(p)   (28)

The function φ(k,C) may or may not be defined for arbitrarily large k.

FIG. 3B illustrates another embodiment. A function φ is chosen as in anyof the embodiments described above in connection with formulae(20)-(28), and is applied to a color vector S to obtain a new angleC′₁=φ(S). C′₁ is the chroma of a color vector S′₁ having the same hueand length as S. In the particular example of FIG. 3B, the length of Sis chosen so that S is outside of gamut 120 but S′₁ is inside the gamut.This may happen, for example, if the gamut's cross section by the planepassing through vectors S and W is other than a circle centered at theorigin O. Such gamuts are not uncommon. Of course, the gamut's shapedepends on the color coordinate system. Many display devices, includingmany computer monitors, have “non-circular” gamut representations inlinear color coordinate systems (i.e. the gamuts' planar cross sectionspassing through the origin are not circles centered at the origin).Further, in many computer monitors and some other display devices, givena fixed hue H (the hue can be defined so as to be constant in a planarcross section passing through the origin), the maximum brightnessincreases as the color becomes closer to white (i.e. as the chroma Cdecreases). Defining the brightness as the color vector's length (theinvention is not limited to this definition however), in many displaydevices the maximum possible brightness B_(max)(C,H)=|S_(Bmax)(S)| is adecreasing function of C, and is strictly decreasing throughout therange of all the possible C values or at least in a sub-range of thepossible C values. Therefore, S might be such that |S|>B_(max)(C,H) but|S′₁|≦B_(max)(C′,H), i.e. S is outside of the gamut 120 but S′, isinside the gamut as in FIG. 3B.

In some gamut mapping embodiments, S is mapped into S′₁ even if S′₁ isnot on the gamut boundary. In other embodiments, S is mapped into avector S′₂ which has the same length as S and lies on the gamutboundary. The chroma C′₂ of S′₂ is less than C but greater than C′₁.More particularly, FIG. 3B shows a circular arc 310 with the center atthe origin O and the radius equal to the length of S. The arc lies inthe same plane as S and W. Arc 310 intersects the gamut boundarysomewhere between the vectors S and W, and the point of intersectiondefines the vector S′₂. Thus, the gamut mapping is defined as follows:vector S outside of the target gamut is mapped into a vector S′ whichlies on the gamut boundary and in the same plane as S and W and has achroma C′ defined as follows:

C′=C′ ₁ if B _(max)(C′ ₁ ,H)≦|S|

C′=C′ ₂ if B _(max)(C′ ₁ ,H)>|S|  (28.1)

A portion of arc 310 to the right of W corresponds to colors havingdifferent chroma values C but having the same brightness B and the hue Has the color S. Clearly, C′₂ is the maximum chroma value for suchcolors. Denote C′₂=C_(max)(B,H). Then the mapping (28.1) can berepresented as follows:

C′=max(C′ ₁ , C′ ₂)   (28.2A)

or, equivalently,

C′=max(φ(S), C _(max)(B,H))   (28.2B)

C_(max)(B,H) may be undefined for some B values, e.g if B is larger thanthe maximum brightness in gamut 120. In such cases, we can set C′=C′₁.For example, we can define:

φ₁(S)=max(φ(S), C _(max)(B,H)) if C _(max)(B,H) is defined,

φ₁(S)=φ(S) if C _(max)(B,H) is undefined.   (28.3)

Then,

C′=φ ₁(S)   (28.4)

If gamut 120 is bounded, and φ(S) satisfies (22), then φ₁(S) alsosatisfies (22) since φ₁(S)=φ(S) for large k. Further, in some displaydevices (including many computer monitors), C_(max)(B,H) is a decreasingfunction of B, and is strictly decreasing in the range of all thepossible B values or at least in some sub-range of the possible Bvalues. (Of note, if B_(max)(C,H) is a decreasing or strictly decreasingfunction of C, and the target gamut is convex, then C_(max)(B,H) willalso be respectively a decreasing or strictly decreasing function of B.)For such gamuts, if φ(S) decreases in |S|, then φ₁(S) also decreases in|S|. If φ(S) satisfies one or more of (23)-(26B), then φ₁(S) alsosatisfies the same one or more of (23)-(26B) at least if C_(max)(B,H) isstrictly decreasing throughout the range of possible B values (andpossibly even if C_(max)(B,H) is not strictly decreasing throughout).

We will now discuss some appropriate ways to define an angle between twocolors. In a linear coordinate system, the angle between colors S and Wcan be defined as:

$\cos^{- 1}\frac{\left( {S,W} \right)}{{S}{W}}$

where (S,W) is the dot product of S and W, and |•| denotes a vector'slength. The dot product can be defined in different ways, for example:

(S,W)=s ₁ w ₁ +s ₂ w ₂ +s ₃ w ₃   (29)

where (s₁,s₂,s₃) and (w₁,w₂,w₃) are coordinates of S and W respectively.The equation (29) is the usual dot product definition when thecoordinate system is orthonormal, i.e. the coordinate axes are mutuallyorthogonal and the unit vector along each coordinate has a unit length.Orthonormality can be defined as in U.S. patent application Ser. No.11/432,221 filed May 10, 2006 by S. N. Bezryadin et al., entitled“EDITING OF DIGITAL IMAGES, INCLUDING (BUT NOT LIMITED TO) HIGHLIGHTINGAND SHADOWING OF IMAGE AREAS”, published as no. 2007/0146831 A1 on Jun.28, 2007, incorporated herein by reference. More particularly, a linearcolor coordinate system is called orthonormal if its color matchingfunctions (CMF's) t ₁, t ₂, t ₃ form an orthonormal system in L₂ on[0,∞) (or on any interval containing the visible range of the λ valuesif the color matching functions are zero outside of this range). Inother words:

∫ t ₁(λ) t ₂(λ)dλ=∫ t ₁(λ) t ₃(λ)dλ=∫ t ₂(λ) t ₃(λ)dλ=0

∫[ t ₁(λ)]² dλ=∫[ t ₂(λ)]² dλ=∫[ t ₃(λ)]² dλ=K   (30)

where the integration is over the entire L₂ interval (e.g. [0,∞) or thevisible range), and K is a positive constant dependent on themeasurement units chosen for the wavelength λ and the radiance P(λ). Theunits can be chosen so that K=1.

The integrals in (30) can be replaced with sums if the CMF's are definedat discrete λ values, i.e.:

$\begin{matrix}{{{\sum\limits_{\lambda}{\overset{\_}{t_{1}}\; (\lambda){\overset{\_}{t_{2}}(\lambda)}}} = {{\sum\limits_{\lambda}{{\overset{\_}{t_{2}}(\lambda)}{\overset{\_}{t_{3}}(\lambda)}}} = {{\sum\limits_{\lambda}{{\overset{\_}{t_{1}}(\lambda)}{\overset{\_}{t_{3}}(\lambda)}}} = 0}}}{{\sum\limits_{\lambda}\left\lbrack {\overset{\_}{t_{1}}(\lambda)} \right\rbrack^{2}} = {{\sum\limits_{\lambda}\left\lbrack {\overset{\_}{t_{2}}(\lambda)} \right\rbrack^{2}} = {{\sum\limits_{\lambda}\left\lbrack {\overset{\_}{t_{3}}(\lambda)} \right\rbrack^{2}} = K}}}} & (31)\end{matrix}$

where the sums are taken over a discrete set of the λ values. Theconstant K can be different than in (30).

One orthonormal system, DEF, is described in the aforementioned U.S.patent application Ser. No. 11/432,221. DEF can be defined as a lineartransformation of the 1931 CIE XYZ color coordinate system for a 2^(o)field as follows:

$\begin{matrix}{\begin{bmatrix}D \\E \\F\end{bmatrix} = {A_{{XYZ} - {DEF}}\begin{bmatrix}X \\Y \\Z\end{bmatrix}}} & (32)\end{matrix}$

where:

$\begin{matrix}{A_{{XYZ} - {DEF}} = \begin{bmatrix}0.205306 & 0.712507 & 0.467031 \\1.853667 & {- 1.279659} & {- 0.442859} \\{- 0.365451} & 1.011998 & {- 0.610425}\end{bmatrix}} & (33)\end{matrix}$

The DEF system's CMF's d(λ), ē(λ), ƒ(λ) corresponding to the respectivecoordinates D, E, F can therefore be obtained from the XYZ CMF's x(λ),y(λ), z(λ) corresponding to the respective coordinates X, Y, Z using thematrix A_(XYZ-DEF):

$\begin{bmatrix}{\overset{\_}{d}(\lambda)} \\{\overset{\_}{e}(\lambda)} \\{\overset{\_}{f}(\lambda)}\end{bmatrix} = {A_{{XYZ} - {DEF}}\begin{bmatrix}{\overset{\_}{x}(\lambda)} \\{\overset{\_}{y}(\lambda)} \\{\overset{\_}{z}(\lambda)}\end{bmatrix}}$

The D axis (FIG. 5) of the DEF system represents multiples of the CIED₆₅ white color standard. Thus, W can be chosen as parallel to the Daxis. The F axis represents the monochromatic red color with λ=700 nm.The visible gamut is a non-circular cone with the vertex at the originO, extending upward from the origin. The source gamut 110 (FIG. 6) canbe the entire visible gamut or some other gamut. For example, the sourcegamut may include infrared, ultraviolet, X-ray, or other colorsdetectable by a suitable camera.

Also described in the aforementioned U.S. patent application Ser. No.11/432,221 and illustrated in FIG. 5 is a spherical coordinate systemBCH (Brightness, Chroma, Hue) based on DEF. For any color S=(D,E,F), itsBCH coordinates are:

B=√{square root over (D ² +E ² +F ²)}=|S|

C (“chroma”) is the angle between the vector S and the D axis (and hencebetween S and W);

H (“hue”) is the angle between (i) the orthogonal projection S_(EF) ofthe vector S on the EF plane and (ii) the E axis.

The BCH coordinate system is convenient for some embodiments of(20)-(28.4).

In some embodiments (FIG. 7), for each color S outside of gamut 120 andsuch that S_(Bmax)(S) is not zero (as in (17)), S′ is obtained accordingto one or more of formulae (20)-(28.4). Hence, the hue H is unchanged.

This mapping can also be performed using suitable α and β functions asin FIG. 3A and equation (5). It is clear from the geometry of FIG. 7that:

|α(S)S|=|S′|sin C′/sin C   (34)

and hence

$\begin{matrix}{{\alpha (S)} = \frac{{S^{\prime}}\; \sin \; C^{\prime}}{{S}\; \sin \; C}} & (35)\end{matrix}$

Using the sine theorem for the triangle formed by the D axis, the S′vector, and the line parallel to S and passing through the end of S′, weobtain:

$\frac{{{\beta (S)}W}}{\sin \left( {C - C^{\prime}} \right)} = \frac{S^{\prime}}{\sin \; C}$

and therefore

${\beta (S)} = \frac{{S^{\prime}}\; {\sin \left( {C - C^{\prime}} \right)}}{{W}\; \sin \; C}$

Denoting now α(k)=α(kS_(Bmax)) and β(k)=β(kS_(Bmax)) as in (12), andassuming that B′=|S′| changes slowly with respect to B=|S| and hencewith respect to k=|S|/|S_(Bmax)(S)|, and further noting that S_(Bmax)(S)and sin C are independent of k, we see from (35) that

α(k)k≈c₁×sin C′

where c₁ is a positive constant. For small C′, sin C′≈C′, so

C′≈c₂×α(k)k

where c₂ is a positive constant. If k=1, then S′=S in the gamut clippingcase, and hence C′=C. Further (see (13C)), α(1)=1. Therefore, c₂=1 forsmall C. If α(k) is as in (14) for example, then C′ is roughly as in(27) at least for small C.

Turning now to step 410 (FIG. 4), let us denote the input colors asS_(in), the colors output by step 410 as S_(out), and the output of step420 as S′. The subscript “in” will be used for the S_(in) coordinates,e.g. S_(in)=(B_(in),C_(in),H_(in)). The subscript “out” will be used forthe S_(out) coordinates. The apostrophe will be used for the S′coordinates, e.g. S′=(B′,C′,H′).

In some embodiments, step 410 involves rotating each vector S_(in) thatdoes not satisfy (17), without changing the hue H and without changingthe brightness B. See FIG. 8. The rotation is therefore performed in theplane containing S_(in) and its projection S_(EF). If target gamut 120contains vectors with a non-zero chroma (C) for this hue value, letC_(t-max)(H) denote the maximum chroma. In FIG. 8, the target gamut is acircular cone symmetric with respect to the D axis, so C_(t-max)(H) isconstant (i.e. independent of H). Other embodiments have non-constantC_(t-max)(R). In FIG. 8, for each hue H, the target gamut 120 contains anon-zero vector with chroma equal to C_(t-max)(R). If such a vector doesnot exist for some H, i.e. if the maximum chroma is reached only for thezero vector, then we can set C_(t-max)(H) to a slightly smaller positivevalue for which a non-zero vector exists in the target gamut.

Step 410 maps C_(in) into C_(out) according to some function ƒ:

C _(out)=ƒ(C _(in) ,H) such that C _(out) <C _(t-max)(H)   (36)

S_(out) satisfies (17). FIG. 9 illustrates some possible mappings ƒ.Three mappings are illustrated. The mapping ƒ₁ is clipping:

C _(out) =C _(in) if C _(in) <C _(t-max)(H)

C _(out) =C _(t-max)(H) if C_(in) ≧C _(t-max)(H)   (37)

The mapping ƒ₂ is linear compression:

C _(out) =C _(in) ×C _(t-max)(H)/C _(in-max)(H)   (38)

where C_(in-max)(H) is the maximum saturation for the hue H in thesource gamut. C_(in-max)(H)≦C_(t-max)(R). The mapping ƒ₃ is somefunction between ƒ₂ and ƒ₁. Other mappings are also possible.

Combining (36) with (20)-(28.4), i.e. combining the steps 410 and 420,we obtain for some embodiments:

C′=φ₂(B _(in) ,C _(in) ,H _(in))   (39)

where for fixed C_(in) and H_(in):

φ₂(B_(in),C_(in),H_(in))→0 as B_(in)→∞  (40)

and/or

φ₂(B_(in),C_(in),H_(in)) is a decreasing function of B_(in) at leastwhen B_(in) is sufficiently large, i.e. larger than the maximumbrightness B_(max)(ƒ(C_(in),H_(in)),H_(in)) in the target gamut for hueH_(in) and saturation ƒ(C_(in),H_(in)). The functionφ₂(B_(in),C_(in),H_(in)) is possibly strictly decreasing in B_(in) forat least some values of B_(in)>B_(max)(ƒ(C_(in),H_(in)),H_(in))   (41)

The function φ₂ can be equal to either φ or φ₁. In some embodiments,φ₂(B_(in),C_(in),H_(in)) is constant in B_(in) if C_(in) and H_(in) arefixed and B_(in)<B_(max)(ƒ(C_(in),H_(in)),H_(in)) because step 410 mapsthe color (B_(in),C_(in),H_(in)) into the target gamut in this case andstep 420 makes no further changes to the color.

In some embodiments, S′ is obtained as follows for each S_(in) outsideof target gamut 420:

H′=H_(in)

C′ as in (39)-(41)

B′=min(B_(in),B_(max)(C′,H_(in))) where B_(max)(C′,H_(in)) is themaximum brightness in the target gamut for the chroma C′ and saturationH_(in).

Combining (36) with (27), we obtain for some embodiments:

C′=ƒ(C _(in) ,H _(in))/B _(in) ^(p) *B _(max)(ƒ(C _(in) ,H _(in)),H_(in))^(p)   (42)

or, denoting ƒ(C_(in),H_(in))*B_(max)(ƒ(C_(in),H_(in)),H_(in))^(p) assimply g(C_(in),H_(in)):

C′=g(C _(in,) H _(in))/B _(in) ^(p)   (43)

where p is independent of B_(in). In some embodiments, p is alsoindependent of C_(in) and/or H_(in). In some embodiments, p satisfies(16). S′ is then obtained by setting H′=H_(in) andB′=min(B_(in),B_(max)(C′,H_(in))).

Combining (36) with (5), (6), (7A), (7B), we obtain for someembodiments:

S′=α(S _(in))S _(in)+β(S _(in))W

where for a fixed S_(in) and k→∞:

α(kS_(in))kS_(in)+β(kS_(in))W→β₀W   (44)

i.e.

α(kS_(in))k→0   (45A)

β(kS_(in))→β₀   (45B)

Combining (36) with (9A), (9B), we obtain for some embodiments that forall ordered pairs (k₁,k₂), k₁<k₂, of positive numbers such that k₁S_(in)and k₂S_(in) are in the source gamut but outside of the target gamut,the following conditions hold true:

α(k ₁ S _(in))k ₁≧α(k ₂ S _(in))k ₂, and

α(k ₁ S _(in))k ₁>α(k ₂ S _(in))k ₂ for at least one pair (k ₁ ,k ₂);  (46A)

β(k ₁ S _(in))≦β(k ₂ S _(in)), and

β(k ₁ S _(in))k ₁<β(k ₂ S _(in)) for at least one pair (k ₁ ,k ₂).  (46B)

In some embodiments, conditions (46A), (46B) hold for all ordered pairs(k₁,k₂), k₁<k₂, of positive numbers such k₂S_(in) is in the source gamutbut outside of the target gamut (i.e. k₁S_(in) can be inside the targetgamut).

In some embodiments, the orthonormality conditions (30) or (31) arereplaced with quasi-orthonormality conditions, i.e. the equations (30)or (31) hold only approximately. More particularly, CMF's t ₁(λ), t₂(λ), t ₃(λ) will be called herein quasi-orthonormal with an error atmost ε if they satisfy the following conditions:

-   1. each of ∫ t ₁(λ) t ₂(λ)dλ, ∫ t ₁(λ) t ₃(λ)dλ, ∫ t ₂(λ) t ₃(λ)dλ    is in the interval [−ε,ε], and-   2. each of ∫[ t ₁(λ)]² dλ, ∫[ t ₂(λ)]²dλ, ∫[ t ₃(λ)]²dλ is in the    interval [K−ε,K+ε],    for positive constants K and ε. In some embodiments, ε is 0.3K, or    0.1K, or some other value at most 0.3K, or some other value.    Alternatively, the CMF's will be called quasi-orthonormal with an    error at most ε if they satisfy the following conditions:

${1.\mspace{11mu} {each}\mspace{14mu} {of}\mspace{14mu} {\sum\limits_{\lambda}{\overset{\_}{t_{1}}\; (\lambda){\overset{\_}{t_{2}}(\lambda)}}}},{\sum\limits_{\lambda}{{\overset{\_}{t_{1}}(\lambda)}{\overset{\_}{t_{3}}(\lambda)}}},\mspace{25mu} {\sum\limits_{\lambda}{{\overset{\_}{t_{2}}(\lambda)}{\overset{\_}{t_{3}}(\lambda)}\mspace{11mu} {is}\mspace{14mu} {in}\mspace{14mu} {the}\mspace{14mu} {{interval}\mspace{11mu}\left\lbrack {{- ɛ},ɛ} \right\rbrack}}},{and}$${{2.\mspace{11mu} {each}\mspace{14mu} {of}\mspace{14mu} {\sum\limits_{\lambda}\left\lbrack {\overset{\_}{t_{1}}\; (\lambda)} \right\rbrack^{2}}},{\sum\limits_{\lambda}\left\lbrack {\overset{\_}{t_{2}}(\lambda)} \right\rbrack^{2}},\mspace{25mu} {\sum\limits_{\lambda}{\left\lbrack {\overset{\_}{t_{3}}(\lambda)} \right\rbrack^{2}\mspace{14mu} {is}\mspace{14mu} {in}\mspace{14mu} {the}\mspace{14mu} {{interval}\mspace{11mu}\left\lbrack {{K - ɛ},{K + ɛ}} \right\rbrack}}}}\mspace{11mu}$

for positive constants K and ε. In some embodiments, ε is 0.3K, or 0.1K,or some other value at most 0.3K, or some other value. Orthonormalfunctions are quasi-orthonormal, but the reverse is not always true. Ifε=0.1K, the functions will be called 90%-orthonormal. More generally,the functions will be called n%-orthonormal if ε is (100−n)% of K. Forexample, for 70%-orthonormality, ε=0.3K.

The invention is not limited to the embodiments described above. Someembodiments include a computer-implemented method for mapping image datainto a target gamut, the image data representing an image whichcomprises one or more colors S each of which satisfies a condition (G1)which is as follows:

(G1) S is outside of the target gamut but a color cS is inside thetarget gamut for at least one positive c.

The method comprises at least the following operation (and may includeadditional operations not recited below, the term “comprises” beingsynonymous to “includes”): for each color S satisfying the condition(G1), a color S′ is generated to map the color S into the color S′,wherein

S′=α(S)S+β(S)W

wherein the plus operation “+” denotes addition of colors in the sensethat the color S′ can be produced by combining light sources producingthe individual colors α(S)S, β(S)W (equivalently, the “+” operation isaddition in a linear color coordinate system). In this equation:

(i) S′ is in the target gamut, or at least in some neighborhood of thetarget gamut, i.e. in an “ε_(G)-neighborhood” of the target gamut. Inother words, a color

(1−ε_(G))S′

is in the target gamut, where ε_(G) is a predefined non-negativeconstant independent of S and not exceeding 1/10, or 1/20, or even asmaller bound. Further:

(ii) W is a predefined color independent of S, where W is not zero in alinear color coordinate system, and where uW is inside the target gamutfor at least one u>0. W can be a white color. Further,

(iii) α(S) and β(S) are non-negative, and satisfy one or both ofconditions (A) and (B), the conditions (A) and (B) being as follows:

(A) when k>0 and k→∞, then

α(kS)k→0 and

β(kS)→β₀,

where β₀ is a positive number independent of S;

(B) for all pairs (k₁,k₂) of positive numbers which satisfy bothconditions (B1) and (B2) below, α(•) and β(•) satisfy (B3) and (B4)below:

(B1) pair (k₁,k₂) is ordered, such that k₁<k₂. Alternatively, (k₁,k₂)may or may not be ordered but is “ε_(M)-ordered”, i.e. k₂>k₁(1+ε_(M))for some predefined non-negative number ε_(M) independent of S. In someembodiments, ε_(M) does not exceed 1/10, or 1/20, or even a smallerbound.

(B2) k₁S and k₂S are outside of the target gamut.

(B3) β(k₂S)≧β(k₁S), and

β(k₂S)>β(k₁S) for at least one pair (k₁,k₂) satisfying (B1) and (B2).

(B4) α(k₂S)k₂≦α(k₁S)k₁, and

α(k₂S)k₂<α(k₁S)k₁ for at least one pair (k₁,k₂) satisfying (B1) and(B2).

In some embodiments, the mapping operation is also performed for eachcolor S which is represented by the image data but does not satisfy thecondition (G1).

In some embodiments, the mapping operation corresponds to just step 420or to a combination of steps 410, 420. Thus, in some embodiments, themapping operation is step 420 and is preceded by another operation inwhich for each color S_(in) which is outside of the target gamut anddoes not satisfy the condition (G1), is replaced with a color S whichsatisfies the condition (G1).

In some embodiments, S′ is on the target boundary, or at least in anε_(G)-neighborhood of the target gamut's boundary, i.e. kS′ is outsideof the target gamut for each k>1+ε_(G).

In some embodiments, 0<α(k)≦1/k^(1+p) and 1>β(k)/β₀≧1−1/k^(q) when k≧1,wherein α(k) and β(k) are functions such that for each said color Ssatisfying the condition (G1),

α(k)=α(kS _(Bmax)(S)) and β(k)=β(kS _(Bmax)(S))

where S_(Bmax)(S) is colinear to S and is on the target gamut'sboundary, where p and q are numbers which are constant with respect tok.

Some embodiments include a computer-implemented method for mapping imagedata into a target gamut, the image data representing an image whichcomprises one or more colors S each of which satisfies the condition(G1), the method comprising, for each color S satisfying the condition(G1), generating a color S′ to map the color S into the color S′,wherein

S′=α(S)S+β(S)W

wherein:

(i) S′ is in an ε_(G)-neighborhood of the target gamut's boundary, whereε_(G) is a predefined non-negative constant independent of S and notexceeding 1/10 or 1/20 or some other bound;

(ii) W is a predefined color independent of S, where W is not zero in alinear color coordinate system, and where uW is inside the target gamutfor at least one u>0;

(iii) α(S) and β(S) are non-negative, and β(•) satisfies one or both ofconditions (A) and (B), the conditions (A) and (B) being as follows:

(A) when k>0 and k→∞

β(kS)→β₀, where β₀ is a positive number independent of S;

(B) for all pairs (k₁,k₂) of positive numbers which satisfy bothconditions (B1) and (B2) below β(•) satisfies (B3) below, wherein thecondition (B1) is specified for a predefined non-negative number ε_(M)independent of S and not exceeding 1/10 or 1/20 or some other bound:

(B1) pair (k₁,k₂) is ε_(M)-ordered, i.e. k₂>k₁(1+ε_(M));

(B2) k₁S and k₂S are outside of the target gamut;

(B3) β(k₂S)≧β(k₁S), and

β(k₂S)>β(k₁S) for at least one pair (k₁,k₂) satisfying (B1) and (B₂).

In some embodiments, the mapping operation is also performed for eachcolor S which is represented by the image data but does not satisfy thecondition (G1).

Some embodiments include a computer-implemented method for mapping inputimage data representing an image into a target gamut, the image datarepresenting an image which comprises one or more colors S each of whichsatisfies the condition (G1), the method comprising: for each colorvector S specifying a color satisfying the condition (G1), performing amapping operation generating a color vector S′ to map S into S′, whereinthe vector S′ forms an angle C′ with a predefined non-zero color vectorW in an ε-orthonormal linear color coordinate system where εis at least70%, or at least 90%, or at least some other number, the color vector Wbeing independent of S and such that uW is inside the target gamut forat least one u>0, wherein

C′=Φ(S)

wherein:

(i) S′ is in an ε_(G)-neighborhood of the target gamut, where ε_(G) is apredefined non-negative constant independent of S and not exceeding 1/10or 1/20 or some other bound;

(ii) Φ(•) is a predefined function satisfying one or both of conditions(A) and (B), the conditions (A) and (B) being as follows:

(A) when k>0 and k→∞, then

Φ(kS)→0;

(B) for all pairs (k₁,k₂) of positive numbers which satisfy bothconditions (B1) and (B2) below, Φ satisfies (B3) below, wherein thecondition (B1) is specified for a predefined non-negative number ε_(M)independent of S and not exceeding 1/10 or 1/20 or some other bound:

(B1) pair (k₁,k₂) is ε_(M)-ordered;

(B2) k₁S and k₂S are outside of the target gamut;

(B3) Φ(k₂S)≦Φ(k₁S), and

Φ(k₂S)<Φ(k₁S) for at least one pair (k₁,k₂) satisfying (B1) and (B2).

For example, φ can be any of the functions φ, φ₁, φ₂ discussed above inconnection with (20)-(41).

In some embodiments, the mapping operation is also performed for eachcolor S which is represented by the image data but does not satisfy thecondition (G1).

In some embodiments,

0<Φ(S)≦C/k^(p)

where C is the angle between S and W, and k is such that

S=kS _(Bmax)(S)

where S_(Bmax)(S) is colinear to S and is on the boundary of the targetgamut, where p is a positive number which is constant with respect to k.

The invention provides a computer system programmed to perform any oneor more of the methods described above, and one or more computerreadable media comprising one or more computer instructions operable tocause a computer system to perform any one or more of the methodsdescribed above. The methods can be performed by a combination ofsoftware programmed parts and/or hardwired circuitry. The inventionincludes software products (computer program products) for programmingcomputers to perform one or more of the gamut mapping operationsdescribed above. The invention includes transmitting one or morecomputer instructions over a network, wherein the one or more computerinstructions are operable to cause a computer system to perform any oneor more of the methods described above. In particular, the inventionincludes downloading such instructions over a network. The inventionincludes electromagnetic signals carrying such programs andinstructions.

The invention is not limited to the embodiments described above. Forexample, the target gamut 120 does not have to be the gamut of displaydevice 240 but can be some intermediate gamut. Thus, if device 240 is aprinter, gamut 120 can be an RGB gamut which can be convenientlyconverted to the printer's gamut. W does not have to be any particularwhite color standard, and may be a non-white color. Other embodimentsand variations are within the scope of the invention, as defined by theappended claims.

APPENDIX A //Gamut mapping for linear RGB system. Target gamut is theset of // all colors with RGB coordinates from 0 to 1 inclusive. //Source gamut has only non-negative RGB coordinates void run(_cmss_vector &vector ) const  //vector=S=(R,G,B) {   float _max = 0; //_max = max (R,G,B) = k   int _pos;   for( _pos = 0; _pos < 3; _pos++ )  {   if( _max < vector [_pos] )   {   _max = vector [_pos];   }   }  if( _max > 1.0f ) //if S is outside target gamut   { // Angledecreasing; here p=1/2   float _coeff = sqrtf( _max ); //_coeff=k^(p) //White addition   float _white = ( _coeff − 1.0f ) * _max;//_white=k(k^(p)−1)   for( _pos = 0; _pos < 3; _pos++ )   {   vector[_pos ] = ( vector[ _pos ] + _white ) / ( _coeff * _max );                   //vector=S′ as in (18)   }   } }

1. A computer-implemented method for mapping image data into a targetgamut, the image data representing an image which comprises one or morecolors S each of which satisfies a condition (G1) which is as follows:(G1) S is outside of the target gamut but a color cS is inside thetarget gamut for at least one positive c, the method comprising, foreach color S satisfying the condition (G1), generating a color S′ to mapthe color S into the color S′, whereinS′=α(S)S+β(S)W wherein: (i) S′ is in an ε_(G)-neighborhood of the targetgamut, i.e. a color(1−ε_(G))S′ is in the target gamut, where ε_(G) is a predefinednon-negative constant independent of S and not exceeding 1/10; (ii) W isa predefined color independent of S, where W is not zero in a linearcolor coordinate system, and where uW is inside the target gamut for atleast one u>0; (iii) α(S) and β(S) are non-negative, and satisfy one orboth of conditions (A) and (B), the conditions (A) and (B) being asfollows: (A) when k>0 and k→∞, then α(kS)k→0 and β(kS)→β₀, where β₀ is apositive number independent of S; (B) for all pairs (k₁,k₂) of positivenumbers which satisfy both conditions (B1) and (B2) below, α(•) and β(•)satisfy (B3) and (B4) below, wherein the condition (B1) is specified fora predefined non-negative number ε_(M) independent of S and notexceeding 1/10: (B1) pair (k₁,k₂) is ε_(M)-ordered, i.e. k₂>k₁(1+ε_(M));(B2) k₁S and k₂S are outside of the target gamut; (B3) β(k₂S)≧β(k₁S),and β(k₂S)>β(k₁S) for at least one pair (k₁,k₂) satisfying (B1) and(B2); (B4) α(k₂S)k₂≦α(k₁S)k₁, and α(k₂S)k₂<α(k₁S)k₁ for at least onepair (k₁,k₂) satisfying (B1) and (B2).
 2. The method of claim 1 whereinthe mapping operation is also performed for each color S which isrepresented by the image data but does not satisfy the condition (G1).3. The method of claim 1 wherein the mapping operation is preceded byanother operation in which for each color S_(in) in the image such thatS_(in) is outside of the target gamut and does not satisfy the condition(G1), Sin is replaced with a color which satisfies the condition (G1).4. The method of claim 1 wherein S′ is in an ε_(G)-neighborhood of thetarget gamut's boundary, i.e. kS′ is outside of the target gamut foreach k>1+ε_(G).
 5. The method of claim 1 where W represents a whitecolor.
 6. The method of claim 4 wherein α and β satisfy the condition(A).
 7. The method of claim 4 wherein α and β satisfy the condition (B).8. The method of claim 4 wherein:0<α(k)≦1/k ^(1+p) and1>β(k)/β₀≧1−1/k ^(q) when k≧1, wherein α(k) and β(k) are functions suchthat for each said color S satisfying the condition (G1),α(k)=α(kS _(Bmax)(S)) and β(k)=β(kS _(Bmax)(S)) where S_(Bmax)(S) iscolinear to S and is on the target gamut's boundary, where p and q arepositive numbers which are constant with respect to k.
 9. The method ofclaim 8 where p and q are independent of S_(Bmax)(S).
 10. The method ofclaim 4 wherein ε_(M)≦ 1/20.
 11. A computer-implemented method formapping image data into a target gamut, the image data representing animage which comprises one or more colors S each of which satisfies acondition (G1) which is as follows: (G1) S is outside of the targetgamut but a color cS is inside the target gamut for at least onepositive c, the method comprising, for each color S satisfying thecondition (G1), generating a color S′ to map the color S into the colorS′, whereinS′=α(S)S+β(S)W wherein: (i) S′ is in an ε_(G)-neighborhood of the targetgamut's boundary, i.e. a color(1−ε_(G))S′ is in the target gamut, and kS′ is outside of the targetgamut for each k>1+ε_(G), where εG is a predefined non-negative constantindependent of S and not exceeding 1/10; (ii) W is a predefined colorindependent of S, where W is not zero in a linear color coordinatesystem, and where uW is inside the target gamut for at least one u>0;(iii) α(S) and β(S) are non-negative, and β(•) satisfies one or both ofconditions (A) and (B), the conditions (A) and (B) being as follows: (A)when k>0 and k→∞, then β(kS)→β₀, where β₀ is a positive numberindependent of S; (B) for all pairs (k₁,k₂) of positive numbers whichsatisfy both conditions (B1) and (B2) below, β(•) satisfies (B3) below,wherein the condition (B1) is specified for a predefined non-negativenumber ε_(M) independent of S and not exceeding 1/10: (B1) pair (k₁,k₂)is ε_(M)-ordered, i.e. k₂>k₁(1+ε_(M)); (B2) k₁S and k₂S are outside ofthe target gamut; (B3) β(k₂S)≧β(k₁S), and β(k₂S)>β(k₁S) for at least onepair (k₁,k₂) satisfying (B1) and (B2).
 12. The method of claim 11wherein the mapping operation is also performed for each color S whichis represented by the image data but does not satisfy the condition(G1).
 13. The method of claim 11 wherein the mapping operation ispreceded by another operation in which for each color S_(in) in theimage such that S_(in) is outside of the target gamut and does notsatisfy the condition (G1), S_(in) is replaced with a color whichsatisfies the condition (G1).
 14. The method of claim 11 where Wrepresents a white color.
 15. The method of claim 11 wherein β(•)satisfies the condition (A).
 16. The method of claim 11 wherein β(•)satisfies the condition (B).
 17. The method of claim 11 wherein ε_(G)=0.18. The method of claim 11 wherein ε_(M)≦ 1/20.
 19. Acomputer-implemented method for mapping input image data representing animage into a target gamut, the image data representing an image whichcomprises one or more colors S each of which satisfies a condition (G1)which is as follows: (G1) S is outside of the target gamut but a colorcS is inside the target gamut for at least one positive c, the methodcomprising: for each color vector S specifying a color satisfying thecondition (G1), performing a mapping operation generating a color vectorS′ to map S into S′, wherein the vector S′ forms an angle C′ with apredefined non-zero color vector W in an ε-orthonormal linear colorcoordinate system where ε is at least 70%, the color vector W beingindependent of S and such that uW is inside the target gamut for atleast one u>0, whereinC′=Φ(S) wherein: (i) S′ is in an ε_(G)-neighborhood of the target gamut,i.e. a color(1−ε_(G))S′ is in the target gamut, where ε_(G) is a predefinednon-negative constant independent of S and not exceeding 1/10; (ii) Φ(•)is a predefined function satisfying one or both of conditions (A) and(B), the conditions (A) and (B) being as follows: (A) when k>0 and k→∞,then Φ(kS)→0; (B) for all pairs (k₁,k₂) of positive numbers whichsatisfy both conditions (B1) and (B2) below, Φ satisfies (B3) below,wherein the condition (B1) is specified for a predefined non-negativenumber ε_(M) independent of S and not exceeding 1/10: (B1) pair (k₁,k₂)is ε_(M)-ordered, i.e. k₂>k₁(1+ε_(M)); (B2) k₁S and k₂S are outside ofthe target gamut; (B3) Φ(k₂S)≦Φ(k₁S), and Φ(k₂S)<Φ(k₁S) for at least onepair (k₁,k₂) satisfying (B1) and (B2).
 20. The method of claim 19wherein the mapping operation is also performed for each color S whichis represented by the image data but does not satisfy the condition(G1).
 21. The method of claim 19 wherein the mapping operation ispreceded by another operation in which for each color S_(in) in theimage such that S_(in) is outside of the target gamut and does notsatisfy the condition (G1), S_(in) is replaced with a color whichsatisfies the condition (G1).
 22. The method of claim 19 wherein S′ isin an ε_(G)-neighborhood of the target gamut's boundary, i.e. kS′ isoutside of the target gamut for each k>1+ε_(G).
 23. The method of claim19 where W represents a white color.
 24. The method of claim 22 whereinΦ(•) satisfies the condition (A).
 25. The method of claim 22 whereinΦ(•)satisfy the condition (B).
 26. The method of claim 18 wherein:0<Φ(S)≦C/k^(p) where C is the angle between S and W, and k is such thatS=kS _(Bmax)(S) where S_(Bmax)(S) is colinear to S and is on theboundary of the target gamut, where p is a positive number which isconstant with respect to k.
 27. The method of claim 26 wherein p isindependent of S_(Bmax)(S)
 28. The method of claim 22 wherein εM≦ 1/20.29. The method of claim 22 wherein ε is at least 90%.
 30. A computersystem to perform the method of claim
 1. 31. A set of one or morecomputer readable media comprising one or more computer instructionsoperable to cause a computer system to perform the method of claim 1.32. A network transmission method comprising transmitting one or morecomputer instructions over a network, wherein the one or more computerinstructions are operable to cause a computer system to perform themethod of claim
 1. 33. A computer system to perform the method of claim11.
 34. A set of one or more computer readable media comprising one ormore computer instructions operable to cause a computer system toperform the method of claim
 11. 35. A network transmission methodcomprising transmitting one or more computer instructions over anetwork, wherein the one or more computer instructions are operable tocause a computer system to perform the method of claim
 11. 36. Acomputer system to perform the method of claim
 19. 37. A set of one ormore computer readable media comprising one or more computerinstructions operable to cause a computer system to perform the methodof claim
 19. 38. A network transmission method comprising transmittingone or more computer instructions over a network, wherein the one ormore computer instructions are operable to cause a computer system toperform the method of claim 19.